#ifndef FUNCTIONS_H
#define FUNCTIONS_H

#include <QObject>
#include <QDebug>
#include <QString>
#include <QList>
#include <QThread>
#include <QtNetwork>

#include <cstdio>
#include <cstdlib>
#include <cstring>


namespace RssGuard {
	enum FeedType {
		FEED_UNKNOWN = 1000,
		FEED_RSS = 1001,
		FEED_ATOM = 1002
	};

	enum LinkType {
		URL = 1000,
		CONTENT = 1001
	};

	enum MouseClickType {
		RIGHT = 10,
		LEFT = 11
	};
}


using namespace RssGuard;


class Functions : QObject {
		Q_OBJECT

	private:
		Functions() { }

	public:
		~Functions() { }
		static bool isValid(QList<QString> list);
		static bool qstrToBool(const QString &value);
        static QNetworkReply::NetworkError downloadFileToQString(const QString &url, QByteArray *output, int timeout);
		static FeedType qstrToFeedType(const QString &string);
		static FeedType intToFeedType(int value);
		static QString feedTypeToQstring(const FeedType &type);

};

struct MemoryStruct {
		char *memory;
		size_t size;
};


#endif // FUNCTIONS_H
